import DataSelect from '@/components/DataSelect'
import DataTable from '@/components/DataTable'
import DataDialog from '@/components/DataDialog'
import SimpleDataSelect from "@/components/SimpleDataSelect";

export default {
    name:'mixin',
    components: {
        DataSelect,
        DataTable,
        DataDialog,
        SimpleDataSelect
    },
    data() {
        return {
            dialogVisible: false,
            dialogTitle:'',
            pagination: {
                pageNum: 1,
                pageSize: 10,
                total: 0,
            },
            isAdd: true,
            searchData:{},
            tableData:[]
        }
    },

    mounted() {
      this.$nextTick(() => {
        this.getListBySearch();
      })
    },
    methods: {
      getListBySearch(){},
      commonSearch(data){
        this.searchData = data
        this.pagination.pageNum = 1
        this.getListBySearch()
      },
      rows(data){
        this.pagination.pageNum = 1
        this.pagination.pageSize = data
        this.getListBySearch()
      },
      pages(data){
        this.pagination.pageNum = data
        this.getListBySearch()
      },
      // 重置
      reset(type) {
        if (type == "search") {
          //搜索组件重置
          for (let key in this.search) {
            let val = this.search[key];
              if (val.constructor == Object) {
                this.search[key].value = null;
              }
            }
            this.pagination.pageNum = 1;
            this.searchData = {};
            this.getListBySearch();
        }
      },
    }
}
